#!/bin/bash

#=======================================================================
# allrevs
# File ID: 11dc9d90-5d37-11df-9afd-90e6ba3022ac
# Lagrer alle versjoner av en fil eller katalogstruktur i en annen 
# katalog.
#=======================================================================

if [ "$2" = "" ]; then
    cat <<END

Syntax: $0 file_or_dir directory_to_store_in

END
    exit 1
fi

[ -d "$2/." ] || { echo "$2: Not a directory" >&2; exit 1; }

for f in `svnrevs -r1:HEAD "$1" | tr -d , | zeropad`; do
    echo ========= $f =======
    svn export -$f "$1" "$2/`echo $1 | tr / _`.$f"
done
